package  common.operations
{
	import drongo.desktop.undo.IOperation;
	
	import flash.events.EventDispatcher;
	
	import module.map.model.ProjectModel;
	
	import robotlegs.bender.extensions.commandCenter.api.ICommand;
	import robotlegs.bender.framework.api.IContext;
	
	public class BaseOperation extends EventDispatcher implements IOperation,ICommand
	{
		protected var __context:IContext;
		public function BaseOperation()
		{
			super();
		}
		
		public function execute():void
		{
			
		}
		public function redo():void
		{
			
		}
		public function undo():void
		{
			
		}
		public function destroy():void
		{
			
		}
		/**
		 * 数据 
		 * @return 
		 */		
		public function get data():Object { return _data; }
		private var _data:Object;
		public function set data(value:Object):void
		{
			if (_data == value)
				return;
			_data = value;
		}
		
		public function get context():*
		{
			return __context;
		}
		
		public function set context(value:*):void
		{
			__context=value;
		}
		
		protected function get project():ProjectModel{
			return this.__context.injector.getInstance(ProjectModel);
		}
	}
}